﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using HighLowTriple7;

namespace WebTriple7.Handler.UserControl
{
    /// <summary>
    /// Summary description for HandlerUCTriple7
    /// </summary>
    public class HandlerUCTriple7 : IHttpHandler, IReadOnlySessionState
    {
        public void ProcessRequest(HttpContext context)
        {
            var t = context.Request.QueryString["t"] ?? "";           

            switch (t)
            {
                case "LoadJackport":
                    LoadJackport(context);
                    break;               
            }
        }

        public void LoadJackport(HttpContext context)
        {
            var info= Triple7.GetGameInfo(Utils.UserUtils.Triple7AccessToken);
            context.Response.ContentType = "application/json";
            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(info.Jackpot));
        }


        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}